-
Notifications
You must be signed in to change notification settings - Fork 0
๐ :: (#22) Connect user Api #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Ensures that generated Dart files are excluded from version control, preventing unnecessary tracking of build artifacts.
Configures dependency injection using GetIt for Dio, CookieJar, APIs, DataSources, and Repositories. This centralizes dependency management and improves testability.
Prevents the app from crashing when the base URL is not defined in the .env file. Logs an error message instead of throwing an exception. Uses an empty string as the base URL if it is null.
Moves the router and menu bottom files to the core directory to better organize the project structure and improve maintainability.
Refactors import paths for data models to align with the project's domain-driven structure. This change improves code organization and maintainability by ensuring components import data models from the correct domain layer.
Updates imports to reflect changes in folder structure. Refactors dependency injection initialization.
Updates dependencies to their latest versions, including dio, retrofit and go_router. Adds retrofit_generator, json_serializable, build_runner, and freezed dependencies for code generation. Introduces freezed_annotation dependency and adjusts retrofit version for compatibility.
Defines the user API using Retrofit for handling sign-in, sign-up, email sending, and email verification functionalities. This API will serve as the interface for interacting with the user authentication backend.
Defines data transfer objects (DTOs) for user sign-in and sign-up requests. These DTOs facilitate communication between the client and server for user authentication purposes. The DTOs are generated using Freezed for immutability and JSON serialization.
Defines an abstract class and its implementation for handling user authentication and email verification operations. This introduces a layer of abstraction for accessing user-related data.
Defines the UserRepository interface with methods for sign-in, sign-up, email verification, and sending email. Implements the UserRepositoryImpl class, which provides concrete implementations of the methods defined in the UserRepository interface, utilizing a UserDataSource for data access.
Moves the asset entity to the domain layer for better separation of concerns. Adds .gitkeep files to the my_capital repositories and use_cases directories to ensure they are included in the repository.
Refactors file structure for better organization and readability. Implements new screens for password creation and school selection during user sign-up. Updates routing logic to accommodate new user flows. Improves UI consistency across the app.
Updates various dependencies to their latest versions, including fl_chart, go_router, retrofit_generator, riverpod, flutter_riverpod and rxdart.
Configures the analyzer to exclude generated files and ignore specific annotation errors, improving code analysis efficiency and reducing noise.
This commit moves the router and menu bottom widget to the config directory. This change aims to improve the project's organization and maintainability by centralizing configuration-related files.
Changes the logging mechanism from 'log' to 'print' for Dio error messages. This simplifies debugging and ensures error messages are consistently displayed in the console.
Adds a Dio interceptor that logs the request body to the console. This aids in debugging network requests by providing visibility into the data being sent to the server.
Sets up dependency injection for sign-in and sign-up features. Registers Dio instances, User and Neis APIs, data sources, repositories, and use cases related to user authentication.
Implements the user data source and its implementation. It introduces methods for user authentication, email verification, and searching schools. It also creates a remote data source to handle the requests and responses from the APIs.
Updates the sign-up DTO to include username and school information. Makes the SignInRequestDto constructor a const factory.
Adds data transfer objects for sign up related API requests and responses. These DTOs are used for school search, email verification, and sending email functionalities. They define the data structure for communication between the client and server during the sign-up process.
Implements mappers for remote requests related to user sign-up, including sending email, verifying email, and searching for schools. Also includes sign-in request mapper.
Removes the old UserRepository interface. This change is part of a refactoring effort to decouple the repository interface from its implementation, enhancing separation of concerns.
Introduces the NeisApi for school search during signup. Renames UserApi file and updates the UserApi to include methods for sending and verifying email during user registration, enhancing user authentication and validation processes.
Implements the user repository to handle sign-in, sign-up, email verification, and school search functionalities. Uses data sources and mappers for data transformation between the data and domain layers.
Creates the `SignInEntity` using Freezed to handle sign-in data. This entity includes email and password fields, along with JSON serialization/deserialization support.
Defines the abstract `SignInRepository` class. This interface outlines the contract for sign-in operations, allowing for different implementations (e.g., local storage, remote API) while maintaining a consistent interface for the rest of the application.
Introduces an abstract class for the sign-in use case. This defines the contract for any class that implements sign-in functionality, promoting loose coupling and testability.
Adds the implementation for the sign-in use case, which orchestrates the sign-in process by utilizing the sign-in repository.
Implements a controller to handle user name input during the sign-up process. The controller manages the text input, validates the username format (Korean characters only, minimum length of 2), and enables/disables a button based on the validation result. It also provides appropriate error messages if the validation fails.
Implements the signup password controller using Riverpod. This controller manages the state and logic for the password and confirm password fields in the signup process. It includes validation for password strength and matching confirmation password. It also handles navigation to the next step in the signup flow.
Creates the `SignupSchoolController` to handle school search and signup logic. This controller manages the school name input, searches for schools based on user input using a debounce mechanism, and handles the signup process with the selected school. It also manages the state of the school search and selection.
Implements mappers to transform data between the presentation layer (states) and the domain layer (entities) for the sign-up feature. Specifically, it creates mappers for email verification and school search functionalities.
Implements states for different parts of the sign-up process, including email, name, password, and school information, using the Freezed package for immutable data classes. This provides a structured way to manage and update the UI state during the registration flow.
Adds a screen for creating a password during signup. Includes password validation and confirmation. Navigates to the next screen upon successful password creation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR integrates the new User API endpoints and refactors the sign-up and sign-in flows to use Riverpod state controllers and clean architecture layers.
- Added Retrofit, Freezed, Riverpod, and code generation dependencies.
- Converted sign-up and sign-in screens from StatefulWidgets to ConsumerWidgets with dedicated controllers.
- Implemented network layer (UserApi, NeisApi), data sources, repositories, use cases, and DI setup.
Reviewed Changes
Copilot reviewed 56 out of 65 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pubspec.yaml | Updated dependencies (Retrofit, Riverpod, Freezed, etc.) |
| lib/presentation/sign_up/state/sign_up_school_state.dart | Added Freezed state for school selection |
| lib/presentation/sign_up/state/sign_up_password_state.dart | Added Freezed state for password entry |
| lib/presentation/sign_up/state/sign_up_name_state.dart | Added Freezed state for username entry |
| lib/presentation/sign_up/screens/password_create_screen.dart | Refactored to ConsumerWidget; hooked up password controller |
| lib/presentation/sign_up/screens/name_input_screen.dart | Refactored to ConsumerWidget; hooked up name controller |
| lib/presentation/sign_up/screens/find_school_screen.dart | Refactored to ConsumerWidget; hooked up school controller |
| lib/presentation/sign_up/screens/email_auth_screen.dart | Refactored to ConsumerWidget; hooked up email controller |
| lib/presentation/sign_up/controller/sign_up_school_controller.dart | Added School search state notifier |
| lib/presentation/sign_up/controller/sign_up_password_controller.dart | Added Password state notifier |
| lib/presentation/sign_up/controller/sign_up_name_controller.dart | Added Username state notifier |
| lib/presentation/sign_up/controller/sign_up_email_controller.dart | Added Email auth state notifier |
| lib/data/user/service/user_api.dart | Defined Retrofit UserApi |
| lib/data/user/service/neis_api.dart | Defined Retrofit NeisApi |
| lib/data/user/data_sources/user_data_source_impl.dart | Implemented UserDataSource with both APIs |
| lib/data/user/repositories/user_repository_impl.dart | Implemented repositories for sign-in/up and school search |
| lib/core/network/api/api_client.dart | Configured Dio and Neis clients; added interceptors |
| lib/core/config/di/dependencies.dart | Wire up DI for network, APIs, data sources, repos, use cases |
| lib/main.dart | Wrapped app in ProviderScope; initialized DI |
Comments suppressed due to low confidence (2)
lib/presentation/sign_up/screens/password_create_screen.dart:65
- [nitpick] The parameter name
Stringshadows the type and can be confusing; consider renaming it to_orvalue.
validator: (String) => null,
lib/presentation/sign_up/screens/name_input_screen.dart:94
- Use a specific callback type like
VoidCallbackinstead of the genericFunctionforonTapparameters.
),
|
|
||
| SignupSchoolController(this._signUpUseCase) : super(SignUpSchoolState()) { | ||
| _schoolNameController.addListener(() { | ||
| _schoolNameSubject.add(_schoolNameController.text); | ||
| }); | ||
|
|
||
| _schoolNameSubject.debounceTime(const Duration(milliseconds: 500)).listen(( |
Copilot
AI
Jul 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The subscription from listen isn't stored; consider saving and cancelling it in dispose to avoid potential memory leaks.
| SignupSchoolController(this._signUpUseCase) : super(SignUpSchoolState()) { | |
| _schoolNameController.addListener(() { | |
| _schoolNameSubject.add(_schoolNameController.text); | |
| }); | |
| _schoolNameSubject.debounceTime(const Duration(milliseconds: 500)).listen(( | |
| StreamSubscription? _schoolNameSubscription; | |
| SignupSchoolController(this._signUpUseCase) : super(SignUpSchoolState()) { | |
| _schoolNameController.addListener(() { | |
| _schoolNameSubject.add(_schoolNameController.text); | |
| }); | |
| _schoolNameSubscription = _schoolNameSubject.debounceTime(const Duration(milliseconds: 500)).listen(( |
Removes unused imports from data layer files. Updates color definition to use withValues method.
Ensures generated code is up-to-date during CI/CD by incorporating the `build_runner` step. This helps prevent analysis errors and ensures consistency.
Co-authored-by: Copilot <[email protected]>
|
์๊ณ ํ์ จ์ต๋๋ค... |
|
LGTM! |
DAMNyul
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ข์๊ฒ ๊ฐ์ต๋๋ค!
Adds the .fvm/ directory to .gitignore to prevent accidental commits of the FVM version cache. Updates the .idea/Jusicool-iOS.iml file, likely due to IDE configuration changes.
โฆicool-Ver-2-0/Jusicool-iOS into feature/#22-connect-user-api
๐ก ๊ฐ์
๐ ์์ ๋ด์ฉ
๐ ๋ณ๊ฒฝ์ฌํญ
๐โโ๏ธ ์ง๋ฌธ์ฌํญ
๐ด ์ฌ์ฉ๋ฐฉ๋ฒ
๐ธ ๊ธฐํ